float4x4 modelViewProj;
texture  cubeTexture;
float4x4 worldMat;
float3   eyePos;

samplerCUBE CubeTextureSampler = 
sampler_state
{
    Texture = <cubeTexture>;
    MipFilter = LINEAR;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
};

struct VS_OUTPUT
{
   float4 position : POSITION;
   float3 texUVW   : TEXCOORD0;
};

VS_OUTPUT sky_vs(float4 objPos : POSITION)
{
   VS_OUTPUT output;
   output.position   = mul(objPos, modelViewProj);
   output.texUVW     = mul(objPos, worldMat).xyz;
   return output;
}

float4 sky_ps(VS_OUTPUT In) : COLOR
{
    return texCUBE(CubeTextureSampler, In.texUVW);
}

technique SkyShader
{
    pass P0
    {          
        VertexShader = compile vs_2_0 sky_vs();
        PixelShader  = compile ps_2_0 sky_ps();
    }
}
